package com.twu.biblioteca;

/**
 * Created with IntelliJ IDEA.
 * User: Demon
 * Date: 13-6-27
 * Time: 下午4:22
 * To change this template use File | Settings | File Templates.
 */
public class BookList {
    private String[] a;

    BookList(){
        a=new String[]{"math","English","PE","chemistry","physics","biology"};
    }
    BookList(int i){
        a=new String[i];
    }

    public int  ShowAllBookList() {
        for (int i=0;i<a.length;i++)
            System.out.println(a[i]);
        return 1;
    }

    public String GetOneBookName(int i){
        return a[i];
    }

    public int GetBookListLength(){
        return a.length;
    }

    public boolean CheckReserveBookIsLegal(String reserve_book_name){
        int i;
        for(i=0;i<a.length;i++){
            //System.out.println(a[i]);
            if(reserve_book_name.equals(a[i])){
                 return true;
             }
         }
        //System.out.println(i);
        System.out.println("Sorry we don't have that book yet");
        return false;
    }
}
